/**
 * Created by John on 2016/7/13.
 */
var MongoClient = require('mongodb').MongoClient;
var mongo = new MongoClient();

mongo.connect('mongodb://localhost/', function (err, db) {
    var myDB = db.db('BeginningMongoDB');
    myDB.collection('word_stats', function (err, collection) {
        collection.count(function (err, count) {
            console.log('Number of Items:');
            console.log(count);
            myDB.close();
        });
    });
});